import { createRouter, createWebHistory } from 'vue-router';
import Home from '../views/Home.vue';
import Base64Tool from '../components/Base64Tool.vue';
import JSONFormatter from '../components/JSONFormatter.vue';
import CronTool from '../components/CronTool.vue';
import QRCodeTool from '../components/QRCodeTool.vue';
import AESTool from '../components/AESTool.vue';
import RSATool from '../components/RSATool.vue';
import HttpDebugger from '../components/HttpDebugger.vue';
import SnippetManager from '../components/SnippetManager.vue';
import MarkdownEditor from '../components/MarkdownEditor.vue';
import FormatTool from '../components/FormatTool.vue';

const RegexTester = () => import('../components/RegexTester.vue');
const UrlTool = () => import('../components/UrlTool.vue');
const TimestampConverter = () => import('../components/TimestampConverter.vue');
const HashTool = () => import('../components/HashTool.vue');

const FeedbackTool = () => import('../components/FeedbackTool.vue');

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home,
  },
  {
    path: '/base64',
    name: 'Base64Tool',
    component: Base64Tool,
  },
  {
    path: '/json',
    name: 'JSONFormatter',
    component: JSONFormatter,
  },
  {
    path: '/cron',
    name: 'CronTool',
    component: CronTool,
  },
  {
    path: '/qrcode',
    name: 'QRCodeTool',
    component: QRCodeTool,
  },
  {
    path: '/aes',
    name: 'AESTool',
    component: AESTool,
  },
  {
    path: '/rsa',
    name: 'RSATool',
    component: RSATool,
  },
  {
    path: '/feedback',
    name: 'FeedbackTool',
    component: FeedbackTool,
  },
  {
    path: '/regex',
    name: 'RegexTester',
    component: RegexTester,
  },
  {
    path: '/url',
    name: 'UrlTool',
    component: UrlTool,
  },
  {
    path: '/timestamp',
    name: 'TimestampConverter',
    component: TimestampConverter,
  },
  {
    path: '/hash',
    name: 'HashTool',
    component: HashTool,
  },
  {
    path: '/http-debugger',
    name: 'HttpDebugger',
    component: HttpDebugger,
  },
  {
    path: '/snippet-manager',
    name: 'SnippetManager',
    component: SnippetManager,
  },
  {
    path: '/markdown-editor',
    name: 'MarkdownEditor',
    component: MarkdownEditor,
  },
  {
    path: '/format-tool',
    name: 'FormatTool',
    component: FormatTool,
  },
];

const router = createRouter({
  history: createWebHistory(), // 根据实际情况调整 base URL，例如 process.env.BASE_URL
  routes,
});

export default router; 